home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks97
/
WarriorsProgress.sit
/
Warrior’s Progress
/
source code
/
Source
/
Libraries
/
Method
/
TextMethodOf.h
< prev
next >
Wrap
Text File
|
1997-06-28
|
573b
|
36 lines
// TextMethodOf.h
#ifndef TextMethodOf_h
#define TextMethodOf_h
#ifndef TextMethod_h
#include "TextMethod.h"
#endif
template <class TargetType>
class TextMethodOf: public TextMethod
{
typedef TargetType Target;
typedef void (Target::*Method)( ConstData );
private:
Target& target;
Method method;
public:
TextMethodOf( Target& theTarget,
Method theMethod )
: target( theTarget ),
method( theMethod )
{
Assert( method != 0 );
}
virtual void operator()( ConstData text )
{
(target.*method)( text );
}
};
#endif